@import '../../styles/colors.less';

.cm-menu {
    display: block;
    margin: 0;
    padding: 0;
    outline: 0;
    list-style: none;
    color: @color-ctx;
    font-size: 14px;
    position: relative;
    z-index: 900;
}
.cm-menu-submenu-title {
    padding: 14px 24px;
    position: relative;
    cursor: pointer;
    z-index: 1;
    transition: all .2s ease-in-out;
    user-select: none;
    &:hover{
        color: @color-blue;
    }
}
.cm-menu-menugroup-title{
    padding: 14px 24px;
    user-select: none;
    color: #999;
    white-space: nowrap;
}
.cm-menu-vertical {
    .cm-menu-submenu-cert{
        position: absolute;
        top: 50%;
        right: 24px;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
        transition: transform 100ms linear;
    }
}
.cm-menu-item {
    display: block;
    outline: 0;
    list-style: none;
    font-size: 14px;
    padding: 14px 24px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all .2s ease-in-out;
}
.cm-menu-vertical{
    .cm-menu-item, 
    .cm-menu-submenu-title {
        padding: 14px 24px;
        position: relative;
        cursor: pointer;
        z-index: 1;
        transition: all .2s ease-in-out;
    }
    .cm-menu-item{
        &.cm-menu-item-active,
        &:hover{
            color: @color-blue;
            background-color: #f0faff;
        }
        &.cm-menu-item-active:after{
            content: '';
            display: block;
            width: 2px;
            position: absolute;
            top: 0;
            bottom: 0;
            right: 0;
            background: @color-blue;
        }
    }
}
.cm-menu-submenu.cm-menu-item-selected{
    >.cm-menu-submenu-title{
        color: @color-blue;
    }
}
.cm-menu-item-open>.cm-menu-submenu-title>.cm-menu-submenu-cert{
    -webkit-transform: translateY(-50%) rotate(180deg);
    transform: translateY(-50%) rotate(180deg);
}

.cm-menu-dark.cm-menu{
    background-color: #515a6e;
    color: #fff;
    .cm-menu{
        color: rgba(255, 255, 255, 0.7);
    }
}
.cm-menu-primary.cm-menu{
    background-color: @color-blue;
    color: #fff;
    .cm-menu{
        color: rgba(255, 255, 255, 0.7);
    }
}
.cm-menu-dark.cm-menu-vertical{
    .cm-menu-item-open {
        background: #363e4f;
    }
    .cm-menu-item{
        &:hover{
            color: #fff;
            background: transparent!important;
        }
    }
    .cm-menu-item.cm-menu-item-active{
        border-right: none;
        color: #fff;
        background: #2d8cf0!important;
    }
    .cm-menu-submenu-title:hover,
    .cm-menu-submenu.cm-menu-item-selected > .cm-menu-submenu-title{
        color: #fff;
    }
}

.cm-menu-horizontal{
    height: 60px;
    line-height: 60px;
    >.cm-menu-item,
    >.cm-menu-submenu{
        float: left;
        padding: 0 20px;
        position: relative;
        cursor: pointer;
        z-index: 3;
        transition: all .2s ease-in-out;
        border-bottom: 2px solid transparent;
    }
    >.cm-menu-submenu.cm-menu-item-selected,
    >.cm-menu-item.cm-menu-item-active{
        color: #2d8cf0;
        border-bottom: 2px solid #2d8cf0;
    }
    .cm-menu-submenu-title{
        padding: 0;
    }
    .cm-menu-submenu-cert {
        margin-left: 5px;
        transition: transform 100ms linear;
    }
    .cm-menu-item-open>.cm-menu-submenu-title>.cm-menu-submenu-cert{
        -webkit-transform: rotate(180deg);
        transform: rotate(180deg);
    }
    .cm-select-dropdown{
        line-height: normal;
    }
    &:after{
        content: "";
        display: block;
        width: 100%;
        height: 1px;
        background: #dcdee2;
        position: absolute;
        bottom: 0;
        left: 0;
    }
    >.cm-menu-submenu,
    >.cm-menu-item{
        height: inherit;
        line-height: inherit;
        &:hover{
            color: #2d8cf0;
            border-bottom: 2px solid #2d8cf0;
            >.cm-dropdown>.cm-dropdown-rel>.cm-menu-submenu-title
            >.cm-menu-submenu-cert{
                -webkit-transform: rotate(180deg);
                transform: rotate(180deg);
            }
        }
    }
    .cm-menu-vertical {
        .cm-menu-item{
            height: inherit;
            line-height: inherit;
            padding: 10px 16px;
            &:hover{
                color: #2d8cf0;
            }
            &.cm-menu-item-active {
                &:after{
                    content: none;
                }
            }
        }
    }
    .cm-dropdown-item{
        padding: 10px 16px;
        &:hover{
            color: #2d8cf0;
        }
    }
    .cm-menu-menugroup-title{
        padding: 4px 16px;
    }

    &.cm-menu-primary,
    &.cm-menu-dark{
        >.cm-menu-submenu.cm-menu-item-selected,
        >.cm-menu-item.cm-menu-item-active{
            color: #2d8cf0;
            border-bottom: 2px solid transparent;
        }
        >.cm-menu-submenu,
        >.cm-menu-item{
            &:hover{
                color: #2d8cf0;
                border-bottom: 2px solid transparent;
            }
        }
    }
    &.cm-menu-primary{
        >.cm-menu-submenu.cm-menu-item-selected,
        >.cm-menu-item.cm-menu-item-active{
            color: #fff;
        }
        >.cm-menu-submenu,
        >.cm-menu-item{
            &:hover{
                color: #fff;
                .cm-menu-submenu-title:hover{
                    color: #fff;
                }
            }
        }
    }
}